/* GUI CONVERTED from eccmtidx.p (converter v1.76) Thu Nov 21 04:06:19 2002 */
/* eccmtidx.p - RETRIEVE NEXT COMMENT FILE INDEX                           */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                     */
/* All rights reserved worldwide.  This is an unpublished work.            */
/*V8:ConvertMode=Maintenance                                               */
/* $Revision: 1.5.1.6 $                                                     */
/* REVISION: 7.4   LAST MODIFIED: 10/08/96   by: *H0N2*   Russ Witt        */
/* REVISION: 8.5   LAST MODIFIED: 07/02/97   by: *J1PM*   Amy Esau         */
/* REVISION: 8.6   LAST MODIFIED: 05/20/98   by: *K1Q4* Alfred Tan         */
/* REVISION: 9.1   LAST MODIFIED: 08/14/00   by: *N0KW* Jacolyn Neder      */
/* $Revision: 1.5.1.6 $ BY: Andrea Suchankova DATE: 03/06/02 ECO: *N13P*  */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/
/* ************************************************************************** */
/* Note: This code has been modified to run when called inside an MFG/PRO API */
/* method as well as from the MFG/PRO menu, using the global variable         */
/* c-application-mode to conditionally execute API- vs. UI-specific logic.    */
/* Before modifying the code, please review the MFG/PRO API Development Guide */
/* in the QAD Development Standards for specific API coding standards and     */
/* guidelines.                                                                */
/* ************************************************************************** */
/******************************************************************
*  This routine is used in the ECN Import/Export process.         *
*  As all ECN records are imported, any attached comments records *
*  will be assigned a new unique comment index for the newly      *
*  created ECN.                                                   *
******************************************************************/

{mfdeclre.i}

define output parameter cmtindx like ds_cmtindx no-undo.

assign_cmt_indx:
repeat:
/*GUI*/ if global-beam-me-up then undo, leave.

   pause 0.

   create cmt_det.
   {mfrnseq.i cmt_det cmt_det.cmt_indx cmt_sq01}

   cmtindx = cmt_indx.
   cmt_seq = ?.
   if recid(cmt_det) = -1 then.
   release cmt_det.
   leave assign_cmt_indx.
end.
/*GUI*/ if global-beam-me-up then undo, leave.

